app.controller('ModifyPasswordCtrl',function ($scope,$http,$state,$localStorage,$location,$window) {
	$scope.namedata = $localStorage.cur_user.uname;
	$scope.save = function(){
		$http.post(
	        $scope.app.backendurl+"admin-user/update-psw",
	        {
	           
	            'current_pwd': $scope.current_pwd,        
	            'new_pwd':$scope.new_pwd,
	            'repeat_new_pwd':$scope.repeat_new_pwd,                  
	            'token':$localStorage.token                   

	        }
	    ).success(function (data) {
	      console.log(data);
	      if(data.code==0&&data.msg=="密码修改成功"){
	         alert(data.msg);
	         $state.go('access.signin');
	      }
	      if(data.code==20001){
	         $location.path('access.signin');
	       }
	    }).error(function (data) {
	        alert(data);
	    })
	}
	
})